<template>
	<view class="main">
		<u-navbar :is-back="true" title="我的设置" :background="background" :border-bottom="false" title-color="#000000"
			back-icon-color="#000" height="48"></u-navbar>
		<view class="phone">	
			<view>手机号</view>
			<view class="phone_r">{{phone}}</view>
		</view>
		<view class="button" @click="back">
			退出登录
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				background: {
					backgroundColor: '#FFFFFF',
				},
				phone:''
			}
		},
		onLoad() {
			this.getlevel()
		},
		methods: {
			//权限
			getlevel() {
				global.$http.request({
					url: '/api/User/info',
					data: {
						token: uni.getStorageSync('token')
					}
				}).then(res => {
					if (res.data.code == 200) {
						this.phone = res.data.data[0].phone
					}
				})
			},
			back(){
				uni.clearStorage()
				uni.showToast({
					title:'退出成功！请重新登录',
					icon:'none',
					duration:1500
				})
				setTimeout(function(){
				uni.navigateTo({
					url:'../../logins/login/login'
				})	
				},1500)
			},
		}
	}
</script>

<style lang="scss">
	page {
		font-family: PingFang SC;
		background-color: #f7f7f7;

		.main {

			.phone {
				margin-top: 10rpx;
				width: 750rpx;
				background: #FFFFFF;
				display: flex;
				justify-content: space-between;
				padding: 36rpx 19rpx;
				align-items: center;
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 400;
				color: #000000;

				.phone_r {
					color: #666666;
				}
			}

			.button {
				position: fixed;
				bottom: 0;
				width: 750rpx;
				height: 98rpx;
				text-align: center;
				line-height: 98rpx;
				background: #E1E4E6;
				font-size: 32rpx;
				font-family: Source Han Sans CN;
				font-weight: 400;
				color: #AFB1B2;
			}
		}
	}
</style>
